//
//  Utils.h
//  Molian
//
//  Created by wan song on 2/12/14.
//  Copyright (c) 2014 memeda. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UIImage+Color.h"
#import "MLUser.h"
typedef void (^CDBlock)();

@interface Utils : NSObject
@property (strong, nonatomic) UIView *viewPrompt;


+(void)alert:(NSString *)msg;
+(NSString *)md5OfString:(NSString*)s;
+(void)alertError:(NSError*)error;
+(NSMutableArray*)setToArray:(NSMutableSet*)set;
+(void)filterError:(NSError*)error callback:(CDBlock)callback;





//上架处理
//检查是否展示提现功能
+ (BOOL)cheackConfigurationWithdraw;
//检查是否使用筛选功能
+ (BOOL)cheackConfigurationScreen;
//对筛选出的用户进行判断是否收费
+ (BOOL)judgeChatCharge;
//是否显示情感热线
+ (BOOL)cheackConfigurationEmotionalHotline;
//是否显示充值的图片
+ (BOOL)cheackConfigurationChangeImage;
//致新用户显示
+ (BOOL)cheackConfigurationUserHint;
//礼物商场是否显示
+ (BOOL)cheackConfigurationGiftShop;
//打卡是否显示
+ (BOOL)cheackConfigurationSignClock;
//话题是否显示
+ (BOOL)cheackConfigurationTopic;


//发送透传
+ (void)sendCmdMessageCMD:(NSString *)cmd ReceiverObjectId:(NSString *)objectId nickname:(NSString *)nickname;
+ (void)sendCmdMessageCMD:(NSString *)cmd ReceiverObjectId:(NSString *)objectId nickname:(NSString *)nickname orderId:(NSString *)orderId;
//保存用户资料完整度
+(void)saveUserDataIntegrityNumber:(NSInteger)number;
//获取用户资料完整度
+(NSInteger)getUserDataIntegrityNumber;


//保存当前口袋恋人的恋人数量
+(void)savePocketloveNumber:(NSInteger)number;
//获取当前口袋恋人的恋人数量
+(NSInteger)getPocketloveNumber;

//number:需要处理的数字， position：保留小数点第几位，
+(double)roundUp:(double)number afterPoint:(int)position;
//保存筛选记录
+(void)screenRecordSex:(NSInteger )sex userType:(NSInteger )userType;
//获取筛选记录s
+(NSDictionary *)screenRecord;
//向plist文件中添加新的存储(存储的都是字典)
+ (void)AddToPlistWithPlistName:(NSString *)plistName andDictionary:(NSDictionary *) dic;
//获取plist文件存储的字典
+ (NSDictionary *)plistName:(NSString *)plistName;
//检查网络
+ (BOOL)inspectNetwork;
// //保存通过的通话申请
//+ (void)savePassChatApplyObjectID:(NSString *)objectID status:(NSInteger)status;
////获取本地存储的通话申请(暂时一直获取)
//+ (NSDictionary *)getPassChatApply;
////删除本地存储的通话申请
//+(void)removePassChatApplyObjectID:(NSString *)objectID;


//保存对话题社的点赞记录
+(void)saveCircleObjectId:(NSString *)objectId;
//获取话题是的点赞记录
+ (NSDictionary *)getPraiseCircle;
//判断是否已经点过赞
+ (BOOL)isPraiseCircleObjectId:(NSString *)objectId;
//判断是不是恋人
+(BOOL)isSweetheartObjectId:(NSString *)objectId;


//判断是不是好友
+(BOOL)isFriendObjectId:(NSString *)objectId;
//保存好友//存字典防止重复
+(void)savePassFriendObjectID:(NSString *)objectID;
//删除指定好友
+(void)removeObjectForFriendObjectID:(NSString *)objectID;
//只保留这个(好友)
+ (void)savePassFriendDictionary:(NSDictionary *)dic;
//获取本地存储的好友列表(暂时一直获取)
+ (NSDictionary *)getPassFriend;

//判断是不是喜欢的人
+(BOOL)isLoveUserObjectId:(NSString *)objectId;
//保存喜欢的人的到字典
+(void)savePassLoveUserObjectID:(NSString *)objectID;
//删除喜欢的人
+(void)removeObjectForLoveUserObjectID:(NSString *)objectID;
//只保留这个字典(喜欢的人)
+ (void)savePassLoveuUserDictionary:(NSDictionary *)dic;
//获取本地存储的喜欢的人列表(暂时一直获取)
+ (NSDictionary *)getPassLoveUser;

//判断是不是喜欢的文章
+(BOOL)isLoveArticleObjectId:(NSString *)objectId;
//保存喜欢的文章的到字典
+(void)savePassLoveArticleObjectID:(NSString *)objectID;
//删除喜欢的文章
+(void)removeObjectForLoveArticleObjectID:(NSString *)objectID;
//只保留这个字典(喜欢的文章)
+ (void)savePassLoveuArticleDictionary:(NSDictionary *)dic;
//获取本地存储的喜欢的文章列表(暂时一直获取)
+ (NSDictionary *)getPassLoveArticle;

//检查文章是否已经阅读
+(BOOL)inspectArticleReadObjectID:(NSString *)objectID;
//保存已经阅读的文章
+(void)saveArticleReadObjectID:(NSString *)objectID;



//保存聊过天的人
+ (void)saveChatUserDictionary:(NSDictionary *)dic;
//保存聊过天的字典
+(void)saveChatUserObjectID:(NSString *)objectID;

//获取聊过天的人的id字典
+ (NSDictionary *)getChatUserDic;
//保存聊过天的用户名字,头像
+(void)saveChatUserDataNicknameUser:(MLUser *)user;
//+(void)saveChatUserDataNickname:(NSString *)nickname headurl:(NSString *)headurl ObjectId:(NSString *)objectId;
//获取聊过天的用户名字,头像
+ (NSDictionary *)getChatUserNicknameHeadurlDic;
//根据用户id获取单个用户的信息
+ (NSDictionary *)getUserNicknameHeadurlObjectId:(NSString *)objectId;


//更改资料后发送给所有需要发送的人(聊过天的和好友)
+ (void)changeUserDataSendUsers;



//退出账号
//一些全局操作
+ (void)quitLogin;
//删除试聊记录
//+ (void)removeTestOrderObjectID:(NSString *)objectID;
////保存聊天订单对方objectID
//+ (void)saveOrderObjectID:(NSString *)objectID;
////判断是否和他聊过天
//+ (BOOL)isOrderObjectID:(NSString *)objectID;
// 生成订单编号
+(NSString *)generateOrderCode;
+(NSString*)generateRandomNumString:(int)num;

+(UIView *)HUDImage :(UIImage*)image Title:(NSString*)title Content:(NSString*)content Timer:(NSTimeInterval)timer;

+(UIView *)Hidden :(UIView*)View Bool:(BOOL)bool2;

+ (void)saveToDefaults:(id)obj forKey:(NSString*)key;

+ (id)defaultsForKey:(NSString *)key;

//归档
+ (void)saveArchiveData:(id)data DIR:(NSString *)dir forKey:(NSString *)key;
//应用主题
+ (void)Theskin:(int)count Vc:(UIViewController*)vc;

+(id)readArchiveData:(NSString *)dir ForKey:(NSString *)key;

//删除归档
+(BOOL)removeItemDIR:(NSString *)dir ForKey:(NSString*)key;

///移动动画
+ (void)animationMobileTimer:(CGFloat )timer View:(UIView*)view Rect:(CGRect)rect;

///弹性动画
+ (void)animationSpringBounciness:(CGFloat )bounciness View:(UIView*)view Rect:(CGRect)rect;

+(CGSize)LabeSizeLabelheight:(NSString*)text Font:(UIFont*)font;
///POP移动动画
+ (void)popBasicAnimationPropertyName:(NSString*)aName toValue:(id)aValue View:(UIView *)view ;
///POP弹性动画
+ (void)popSpringAnimationPropertyName:(NSString*)aName toValue:(id)aValue View:(UIView *)view ;


//只会执行一次的方法
+ (BOOL)onePerform:(NSString*)str;

+(CGSize)LabeSizeText:(NSString*)text Font:(UIFont*)font;

-(void)viewControllerPrompt:(CGRect)rect Text:(NSString*)text Image:(UIImage*)image;

-(void)viewControllerPromptstopAnimating;

+(void)pushTabbarHidden:(UIViewController*)viewController Selfvc:(UIViewController*)selfvc;


+(void)playWavName:(NSString*)wavName;

+(void)loginVC:(UIViewController*)vc;

+(BOOL)userinit:(UIViewController*)vc;
@end
